# -*- coding: utf-8 -*-
__author__ = 'sunnychou'
__date__ = '2019/7/18 15:50'

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import scoped_session
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.exc import *
from sqlalchemy import Column, Integer, String, ForeignKey

MYSQL_CONNECT_STR = "mssql+pymssql://sa:Favor@sqladmin123@180.76.115.157/CRM6?charset=utf8"

Base = declarative_base()

# 初始化数据库连接:
db_conn_str = MYSQL_CONNECT_STR

engine = create_engine(db_conn_str, pool_recycle=3600, echo=False)


def create_orm_db():
    Base.metadata.create_all(engine)  # ORM同步
    print("orm process ok.")


session = sessionmaker(bind=engine)()







